package com.corpgovernment.common.apollo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author yh_yin
 */
@Component
public class ApprovalSystemApollo extends CommonApollo {

    /**
     * 邮件发送者
     */
    @Value("${email_sender:}")
    private String emailSender;
    /**
     * 是否使用mq异步方式启动审批流程
     */
    @Value("${start_approval_mq:false}")
    private boolean startApprovalMq;
    /**
     * 审批人是提交人，是否直接通过
     */
    @Value("${approver_submitter_pass:false}")
    private boolean approverSubmitterPass;
    /**
     * 首页，我的审批
     */
    @Value("${approve_page_size_pc:1}")
    private int approvePageSizePc;
    /**
     * 邮件授权url
     */
    @Value("${email_auth_url:}")
    private String emailAuthUrl;

    @Value("${flow_tmpl_pay_type_default:}")
    private String flowTmplPayType;

    public String getEmailSender() {
        return getAppProperty("email_sender","");
    }

    public boolean isStartApprovalMq() {
        return Boolean.valueOf(getAppProperty("start_approval_mq", "false"));
    }

    public boolean isApproverSubmitterPass() {
        return   Boolean.valueOf(getAppProperty("approver_submitter_pass","false"));
    }

    public int getApprovePageSizePc() {
        return Integer.parseInt(getAppProperty("approve_page_size_pc","1"));
    }

    public String getEmailAuthUrl() {
        return getAppProperty("email_auth_url","");
    }
    public String getFlowTmplPayType() {
        return getAppProperty("flow_tmpl_pay_type_default","");
    }

}
